﻿@model SDAU.GCT.OA.Model.ActionInfo

@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>Edit</title>
    <script src="~/Scripts/jquery-3.3.1.js"></script>
    <script src="~/Scripts/jquery.unobtrusive-ajax.js"></script>
    <script type="text/javascript">
        function afterEdit(data) {
            if (data == "ok") {
                //此处调用父容器的方法
                window.parent.window.afterEditSuccess();
            } else {
                alert("修改失败！！");
            }
        }
        function submitForm() {
            $("form").submit();
        }
    </script>
</head>
<body>
    @using (Ajax.BeginForm(new AjaxOptions() { OnSuccess = "afterEdit" }))
    {
        @Html.AntiForgeryToken()

    <div class="form-horizontal">

        @Html.ValidationSummary(true, "", new { @class = "text-danger" })
        @Html.HiddenFor(model => model.Id)
        @Html.HiddenFor(model => model.Subtime)
        @Html.HiddenFor(model => model.ModfiedOn)
        @Html.HiddenFor(model => model.DelFlag)


        <div class="form-group">
            @Html.LabelFor(model => model.ActionName, "权限名：", htmlAttributes: new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.EditorFor(model => model.ActionName, new { htmlAttributes = new { @class = "form-control" } })
                @Html.ValidationMessageFor(model => model.ActionName, "", new { @class = "text-danger" })
            </div>
        </div>




        <div class="form-group">
            @Html.LabelFor(model => model.Url, "URL：", htmlAttributes: new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.EditorFor(model => model.Url, new { htmlAttributes = new { @class = "form-control" } })
                @Html.ValidationMessageFor(model => model.Url, "", new { @class = "text-danger" })
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.HttpMethod, "Http方法类型：", htmlAttributes: new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.EditorFor(model => model.HttpMethod, new { htmlAttributes = new { @class = "form-control" } })
                @Html.ValidationMessageFor(model => model.HttpMethod, "", new { @class = "text-danger" })
            </div>
        </div>



        <div class="form-group">
            @Html.LabelFor(model => model.IsMenu, "是否是菜单：", htmlAttributes: new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                <div class="checkbox">
                    @Html.EditorFor(model => model.IsMenu)
                    @Html.ValidationMessageFor(model => model.IsMenu, "", new { @class = "text-danger" })
                </div>
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.MenuIcon, "菜单的图标地址：", htmlAttributes: new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.EditorFor(model => model.MenuIcon, new { htmlAttributes = new { @class = "form-control" } })
                @Html.ValidationMessageFor(model => model.MenuIcon, "", new { @class = "text-danger" })
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.Sort,"排序：", htmlAttributes: new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.EditorFor(model => model.Sort, new { htmlAttributes = new { @class = "form-control" } })
                @Html.ValidationMessageFor(model => model.Sort, "", new { @class = "text-danger" })
            </div>
        </div>
        <div class="form-group">
            @Html.LabelFor(model => model.Remark, "备注：", htmlAttributes: new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.EditorFor(model => model.Remark, new { htmlAttributes = new { @class = "form-control" } })
                @Html.ValidationMessageFor(model => model.Remark, "", new { @class = "text-danger" })
            </div>
        </div>

        <div class="form-group">
            <div class="col-md-offset-2 col-md-10">
                <input type="submit" value="保存" class="btn btn-default" />
            </div>
        </div>
    </div>
    }

</body>
</html>
